<?php
	$cookie = 'nei';
	$tid = 36288000;
	$file = "counter.dat";//file lưu lại số lầi truy cập
	if($cookie != "ja") { 
	} 
	else { 
		if(file_exists($file)) { 
			$fil = fopen($file, "r"); 
			$count = fread($fil, 8); 
			fclose($fil); 
		} 
		else {
			$count=0; 
		}
		$count++; 
		$fil = fopen($file, "w"); 
		fwrite($fil, $count); 
		fclose($fil); 
		if($cookie == "ja") { 
		setcookie("count","yes",time()+$tid); 
} 
} 
?>
<div id="login">

		<p id="vistdaily">	<?php include "vistdaily.php";?>		
			Số người truy cập: 			<?php echo visitcount();?> <br/> 
			Số người trực tuyến: <?php echo _whoonline();?><br/>	
		</p>
		<div class="l-top">

							<a href="#" onclick="showlogin()">Login</a>
							<a href="index.html">Site Map</a>
							<a href="#"><img src="<?php echo ROOT_PATH?>/images/mail.jpg" alt="Mail"/></a>
					</div>
                     <div id="showlogin">
						 <span style="height:30px;color:#00C;font-size:14px"><?php if($_SESSION["UserIDst"]!="") echo "<a href='/tnu/editinfo.php'>".$_SESSION["User"]."</a>"."  "."<a href='/tnu/logout.php'>đăng xuất</a>"; ?> </span>
                        
                     </div>
						<div id="search1">
						Tìm kiếm:
						<form name="frmSearch" action="<?php echo ROOT_PATH;?>/search" method="post">
							<input type="text" name="key" id="txtKeyWord" size="20"/>
							<input type="submit" id="btnSearch" value="Search"/>
						</form>
						</div>
						<div class="l-bottom">
							<div class="a1">
							<a href="#"><?php echo ($lang==0)?"Liên kết website":"Website links";?></a>
							
							</div>
							<div class="a2">
							  <select onChange="window.open(this.value);">
                              <option>--Website liên kết--</option>
                             <?php
							  	
							  while($rowweb=mysql_fetch_array($kq1))
							 {
                              echo "<option value='".$rowweb["url"]."'>" .$rowweb["name"]."</option>";
							 }
							?>
                              </select>
							 
							</div>	

					
					
				</div>
			</div><!-- end of login -->